@extends('admin.layout.index')
@section('content')
@if (count($errors) > 0)
	<script>
		alert('{{ $errors }}');
	</script>
@endif
<div class="portlet box blue">

		<div class="portlet-title">

			<div class="caption"><i class="icon-reorder"></i>用户修改</div>

			<div class="tools">

				<a href="javascript:;" class="reload"></a>


			</div>

		</div>

		<div class="portlet-body form">


			<!-- BEGIN FORM-->

			<form action="/admin/user/{{ $data['id'] }}" class="form-horizontal" method="post">
				{{ csrf_field() }}
				<input type="hidden" name="_method" value="PUT">
				<div class="control-group warning">

					<label class="control-label" for="inputWarning">用户名</label>

					<div class="controls">

						<input type="text" class="span6 m-wrap" readonly="" id="username" name="username" value="{{ $data['username'] }}">
						<input type="hidden" class="span6 m-wrap" readonly="" id="username" name="uid" value="{{ $data['id'] }}">

						<span class="help-inline" id='userSpan'></span>

					</div>

				</div>
				<div class="control-group warning">

						<label class="control-label">用户权限<span class="required">*</span></label>

						<div class="controls">

							<select class="span6 m-wrap" name="rid">
							<option>--请选择--</option>
								@foreach($roles as $k=>$v)
								<option value="{{ $v['id'] }}" @if($v['id']==$role['id']) selected @endif>{{ $v->name }}</option>
								@endforeach
							</select>

						</div>

					</div>
				
				<div class="form-actions">

					<input type="submit" class="btn blue" id="submit" value="修改">
					<button type="reset" class="btn">重置</button>

				</div>
				
		
			</form>

			<!-- END FORM-->

		</div>

	</div>
@endsection